<?php



InitGP(array("action")); //初始化变量全局返回



if($action == 'add'){



        InitGP(array('ddlDepot','ddlEx','shops','ex','bag','remark','insure')); //初始化变量全局返回



        include_once(INC_PATH."/goodsforecast.class.php");



        $g = new GoodsForecastClass();



        $addarray = array();



        $count = 0;



        foreach($ex as $key=>$e){



                $addarray["depot"] = GetNum($ddlDepot);



                $addarray["extype"] = Char_cv($ddlEx);



                $addarray["shops"] = Char_cv($shops[$key]);

                

                $addarray["ex"] = Char_cv($ex[$key]);



                $addarray["bag"] = Char_cv($bag[$key]);



                $addarray["remark"] = Char_cv($remark[$key]);



                $addarray["insure"] = GetNum($insure[$key]);



                $addarray["uid"] = $_USERS['uid'];



                $addarray["uname"] = $_USERS['uname'];



                $addarray['addtime'] = time();



                if(!$addarray["depot"] || !$addarray["extype"] || !$addarray["ex"] || !$addarray["bag"]){



                        showmsg('所有的信息必须填写。', '-1');



                }

                if($g->checkEx($addarray["extype"], $addarray["ex"])){
                        showmsg('你添加的快递信息已经存在。', '-1');
                }

                if($g->add($addarray)){



                        $count++;



                }



        }



        if($count){



                showmsg('成功添加！'.$count.' 待收。', 'm.php?status=1&name=depotlist');



        }



}



include template('member_goodsforecast');//包含输出指定模板



?>